import { AppType, getAppType } from "./app-type";

const MiniProTypeMap = {
  [AppType.VIDEO_DISTRIBUTION]: "evediowm", //视频号分销
  [AppType.KS_MINI_PROGRAM]: "ksmini", //快手小程序
  [AppType.E_COMMUNITY]: "mini_program_ecommunity", //鹅圈子小程序
  [AppType.COMMUNITY]: "mini_program_merchant_community", //独立圈子小程序
  [AppType.BRAND]: "brand_app", //品牌app
  [AppType.WX_MINI_PROGRAM_SDK]: "mini_program_wechat_sdk" // 小程序SDK
};

export function resolveMiniProType(appType, isSupportCoin) {
  if (appType === AppType.BRAND && !isSupportCoin) {
    return "";
  }
  const miniProType = MiniProTypeMap[appType];
  return miniProType;
}

export function getMiniProType(isSupportCoin) {
  return resolveMiniProType(getAppType(), isSupportCoin)
}